<div class="article">
	<h2>
		<?php echo htmlspecialchars($this -> article -> title); ?>
	</h2>
	<p class="meta">
		created
			by <?php echo htmlspecialchars($this -> article -> author); ?> 
			at <?php echo date('F j, Y', $this -> article -> creationDate); ?>.
	</p>
	<p class="article">
		<?php echo nl2br(htmlspecialchars($this -> article -> text)); ?>
	</p>
</div>



<?php $commentCount = count($this -> comments); ?>
<h3>Comments (<?php echo $commentCount; ?>)</h3>

<?php if ($commentCount > 0) { ?>
<?php foreach ($this -> comments as $comment) { ?>
	<div class="comment">
		<p class="meta">
			<?php echo htmlspecialchars($comment -> author); ?> 
			at <?php echo date('F j, Y', $comment -> creationDate); ?>.
		</p>
		<p class="comment">
			<?php echo nl2br(htmlspecialchars($comment -> text)); ?> 
		</p>
	</div>
<?php } } else { ?>
	<p>
		No comments yet.
	</p>
<?php } ?>



<h3>Add Comment</h3>
<?php $formAction = $basePath .'/article/add-comment/'; ?>
<?php include 'templates/forms/new-comment-form.php'; ?>
